import editans from './model.js';
import { tipmsg } from '../../utils/http.js';
var obj = new editans;
Page({

  /**
   * 页面的初始数据
   */
  data: {
    anscon: '',
    aid: 0
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.data.aid = options.aid;
    obj.getans(this,options.aid);
  },

  subans(e){
    let ans = e.detail.value.answer;
    if(ans == ''){
      wx.showToast({
        title: '请输入答案',
        icon :'none'
      })
      return false;
    }
    //提交
    obj.edit(ans,this.data.aid);
  }
})